<?php defined('IN_LK') or die('Access Denied');?>
<?php include self::admin_t('header');?>
<dl class="form_list">
  <form action="?m=admin&c=admin_manage&a=admin_edit" method="post" id="myform">
    <dd><span class="left w15">用户名</span><?php echo $username;?>
      <input type="hidden" name="info[roleid]" value="<?php echo $roleid;?>" />
      <input type="hidden" name="info[userid]" value="<?php echo $userid;?>" />
      <input type="hidden" name="info[username]" value="<?php echo $username;?>" />
    </dd>
    <dd><span class="left w15">密码</span>
      <input type="password" class="input" name="info[pwd]" id="pwd" size="25" />
    </dd>
    <dd><span class="left w15">确认密码</span>
      <input type="password" class="input" name="info[pwd2]" id="pwd2" size="25" />
    </dd>
    <dd><span class="left w15">email</span>
      <input type="text" class="input" size="35" name="info[email]" id="email" value="<?php echo $email;?>" />
    </dd>
    <dd> <span class="left w15">所属角色</span> <?php echo $select;?>
      <input class="none" type="submit" id="dosubmit" name="dosubmit" value="提交" />
    </dd>
  </form>
</dl>
</body></html><script type="text/javascript">
$(function()
{
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#pwd").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"密码应该为3-20位之间"}).inputValidator({min:3,max:20,onerror:"密码应该为3-20位之间"});
	$("#pwd2").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"请输入两次密码相同。",oncorrect:"密码输入一致"}).compareValidator({desid:"pwd",operateor:"=",onerror:"请输入两次密码相同。"});
	$("#email").formValidator({onshow:"请输入E-mail",onfocus:"请输入E-mail",oncorrect:"E-mail格式正确"}).regexValidator({regexp:"email",datatype:"enum",onerror:"E-mail格式错误"}).ajaxValidator({
	    type : "get",
		url : "",
		data :"m=admin&c=admin_manage&a=check_email_ajax&userid=<?php echo $userid;?>",
		datatype : "html",
		async:'false',
		success : function(data){
            if( data == "1" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#dosubmit"),
		onerror : "该邮箱已经存在",
		onwait : "请稍候..."
	}).defaultPassed();
});
</script>